package kisti.lod.classification.group;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author Sebastian
 *
 */
public class Group {
	
	protected String groupName;
	protected ArrayList<String> predicates = new ArrayList<String>();
	
	
	/**
	 * Create a group instance with name and without a predicate list
	 * @param name
	 */
	public Group(String name) {
		setGroupName(name);
	}
	
	/**
	 * Create a group with name and with a prediacte list
	 * @param name
	 * @param predicates
	 */
	public Group(String name, ArrayList<String> predicates) {
		setGroupName(name);
		setPredicates(predicates);
	}
	
	/**
	 * Add a predicate to the predicate list
	 * Returns true on success and false on failure
	 * @param predicate
	 * @return
	 */
	public boolean addPredicate(String predicate) {
		if(!predicate.equals("")) {
			predicates.add(predicate);
			return true;
		}
		return false;
	}
	
	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public ArrayList<String> getPredicates() {
		return predicates;
	}

	public void setPredicates(ArrayList<String> predicates) {
		this.predicates = predicates;
	}
}
